# 选择最新修改的文件
src := $(shell ls -t *.c | head -n 1)

ifeq ($(strip $(input)),)
	target = $(basename ${src})
else
	target = $(input)
	src = $(input).c
endif

$(target): $(src)
	$(CC) $(src) -o $(target)

.PHONY: trace, run

trace: $(target)
	strace -T -o $(target).log ./$(target)
	rm $(target)

run:
	./$(target)
	rm $(target)
